- layout      ||= index_branch
- has_siblings  = layout.siblings.select{|l| l.site_id == @site.id}.size > 0

%li{data: {id: layout.id}}
  .row
    .col-md-8.item
      .item-controls.d-none.d-md-block
        - if has_siblings
          .dragger
            %i.fas.fa-bars

      .item-content
        .item-title
          = link_to layout.label, edit_comfy_admin_cms_site_layout_path(@site, layout)
        .item-meta
          = layout.identifier

    .col-md-4.d-flex.align-items-center.justify-content-md-end
      .btn-group.btn-group-sm
        = link_to t('.add_child_layout'), new_comfy_admin_cms_site_layout_path(@site, parent_id: layout.id), class: "btn btn-outline-secondary"
        = link_to t('.edit'), edit_comfy_admin_cms_site_layout_path(@site, layout), class: "btn btn-outline-secondary"
        = link_to t('.delete'), comfy_admin_cms_site_layout_path(@site, layout), method: :delete, data: {confirm: t('.are_you_sure')}, class: "btn btn-danger"

  - if layout.children.present?
    %ul.list.children.sortable.pl-md-3
      = render partial: "index_branch", collection: layout.children.order(:position)
